import 'dart:collection';

import '../../entity/entities/lf_user_entity.dart';

class LfUserCacheManager {
  LfUserCacheManager._internal();

  static final LfUserCacheManager _singleton = LfUserCacheManager._internal();

  factory LfUserCacheManager() => _singleton;

  LinkedHashMap<String, LfUserEntity?> cachePool = LinkedHashMap();

  void setCacheUser({required String key, required LfUserEntity? user}) {
    cachePool[key] = user;
  }

  LfUserEntity? getCacheUser({required String key}) {
    return cachePool[key];
  }

  void clear() {
    cachePool.clear();
  }
}
